Field of the Invention
This invention relates generally to the field of computer processors. More particularly, the invention relates to an apparatus and method for extracting path shading coherence in a ray tracing architecture.
Description of the Related Art
Ray tracing is a graphics processing technique for generating an image by traversing the path of each light ray through pixels in an image plane and simulating the effects of its incidence upon different objects. Following traversal calculations, each ray is typically tested for intersection with some subset of the objects in the scene. Once the nearest object has been identified, the incoming light at the point of intersection is estimated, the material properties of the object are determined, and this information is used to calculate the final color of the pixel.
Production rendering for visual effects has recently undergone a paradigm shift towards ray tracing architectures. Traditionally, most renderers used in feature film were rasterization-based, feed-forward pipelines. However, with the constant demand for increased visual fidelity, many studios and production companies are now switching to ray tracing architectures, where accurate lighting simulations can be performed, yet at a higher computational cost.
In existing architectures, each primitive is visibility tested and shaded in a feed-forward pipeline, and shading is evaluated coherently over grids by design, either in screen space or object space. In a ray tracer, the points to be shaded are not necessarily coherent. For example, in a path tracer (the most commonly used technique in modern production ray tracers), at each diffuse hit point, one or a few rays are emitted in pseudorandom directions over the hemisphere. This ray distribution quickly leads to degraded shading coherence after just a few bounces. It is therefore important to extract some form of shader coherence to increase single instruction multiple data (SIMD) occupancy when shading using SIMD architectures (e.g., such as Intel's AVX instruction set), and to minimize external texture bandwidth due to more coherent texture lookups.
Previous attempts have proposed storing and sorting very large batches of rays (˜33M rays) into coherent packets to reduce disk access for textures [Eisenacher et al. Sorted Deferred Shading for Production Path Tracing], or sorting large ray batches of rays per material to increase utilization for complex shading on 32-wide SIMD units [Laine et al. Megakernels Considered Harmful: Wavefront Path Tracing on GPUs].